<?php
include('includes/init.php');
session_start();
if(isset($_GET['action'])&&$_GET['action']=="logout"){
  session_unset();
  session_destroy();
}
SettingsManager::changeSettings($_POST);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "fr" >
	<head>
		<?php
			$title  = "MovieMood";
			include 'includes/head.php';
		?>
	</head>
	<body>
		<div id = "main">
			<div id = "header"><a id = "zone" href = "index.php" title = "Accueil"></a>
				<div id = "login">
					
					<?php	/** HEADER **/	include("includes/form_login.php") ; ?>
				
				</div>
				
			</div>
			
			<div id = "page">
			
				<div id = "search">
					
					<?php	/** SEARCH BAR **/	include("includes/search.php") ; ?>
					
				</div>	
			
				<div id = "menu_right">
	
					<?php	/** MENU DROITE **/	include("includes/rightMenu.php") ; ?>
					
				</div>
					
				<div id = "menu_left">
				
					<?php	/** MENU GAUCHE **/	include("includes/leftMenu.php") ; ?>
				
				</div>
				
				<div id = "content">
					<div id = "body_top"> </div>

					    <div id = "body">

						    <?php	/** MENU CONTENU **/	
							   if(isset($_GET['action'])){
							    $action = $_GET['action'];
							      switch ($action) {
							    case "title" : include('includes/titre.php');break;
								case "profile" : include('includes/profil.php');break;
								case "register" : include('includes/register.php');break;
								case "add" : include('includes/add.php');break;
								case "valid" : include('includes/valid.php');break;
								case "write" : include('includes/write.php');break;
								case "ban" : include('includes/ban.php');break;
								case "rights" : include('includes/rights.php');break;
								case "valid_rights": include('includes/valid_rights.php');break;
								case "bdd" : include('includes/bdd.php');break;
								case "exec": include('includes/exec.php');break;
								case "search": include('includes/search_result.php');break;
								case "logout" : echo 'Vous avez été deconnecté';break;
								default :echo 'Merci de ne pas jouer avec les parametres';
							      }
							    }
							    else{
							      include("includes/body.php"); 
							    }
						    ?>

					    </div>

					<div id = "body_bottom"> </div>
					
				</div>
				
			</div>
			
			<div id = "footer">
			
				<?php	/** FOOTER **/	include("includes/footer.php") ; ?>
			
			</div>
		
		</div>
		
	</body>
	
</html>